package com.wxzhou.wangzhuan.entity;

/**
 * 收入场景
 */
public enum IncomeSense {
    AD(1, "广告收入"),
    DUANJU(2, "短剧收入"),
    REFUND(3, "系统冲正"),
    SYS_REWARD(4, "系统奖励"), //如：拉新用户、签到奖励等
    YONGJIN(5, "佣金奖励"), //如：广告直推奖励、间推奖励等。
    TASK(6, "任务拉新"),
    CPS(7, "游戏CPS"),
    OTHER(8, "其他");

    private final int code;
    private final String description;

    IncomeSense(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static IncomeSense fromCode(int code) {
        for (IncomeSense status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown ad sense code: " + code);
    }

}
